﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using mendian;
using DXApplicationTangche.DTO;
using DevExpress.XtraGrid.Demos.util;

namespace DXApplicationTangche.UC.款式管理
{
    public partial class Form设计点导入预览 : DevExpress.XtraEditors.XtraForm
    {
        private String styleNameCn { get; set; }
        private List<StyleDesignExcelDTO> styleDesignExcelDTOs = new List<StyleDesignExcelDTO>();
        public Form设计点导入预览(String styleNameCn, List<StyleDesignExcelDTO> styleDesignExcelDTOs)
        {
            InitializeComponent();
            this.styleNameCn = styleNameCn;
            this.styleDesignExcelDTOs = styleDesignExcelDTOs;
            this.gridControl导入设计点预览.DataSource = this.styleDesignExcelDTOs;
        }

        private void simpleButton扫员工码并导入_Click(object sender, EventArgs e)
        {
            Form导入确认扫员工码 form = new Form导入确认扫员工码();
            form.ShowDialog();
            if (!String.IsNullOrEmpty(form.mnemonic))
            {
                RestCall.PostHttp(
                    URL.接口url + "/style/saveDesignPointByMnemonicAndStyleNameCn?mnemonic=" + form.mnemonic
                                + "&styleNameCn=" + this.styleNameCn,
                    FunctionHelper.JsonSerialization(this.styleDesignExcelDTOs));
                MessageBox.Show("导入成功");
            }
            else
            {
                MessageBox.Show("请重新点击");
            }
            this.Close();
        }
    }
}